<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>calypso_card_read_c.html</title>
<!-- Source : c:/temp/calypso/calypso_card_read.c -->
<!-- Doc generated on Thu Jun 24 12:26:46 2010 by johann on PC_DEV_5 -->
<!-- Generated with ROBODoc Version 4.99.8 (Specific build by PRO ACTIVE - Apr 13 2010) -->
<style type="text/css">
body
{
  background-color: #ffffff;
  color: #000000;
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 9pt;
  margin-left: 60px;
  margin-right: 40px;  
}
table
{
  border-collapse: collapse;
  border-style: solid;
  border-width: 1px;
  border-color: #000000;
  margin-bottom: 12px;
}
td
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 9pt;
  vertical-align: top;
  padding-right: 6px;
  border-style: solid;
  border-width: 1px;
  border-color: #dddddd; 
}
th
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 9pt;
  vertical-align: top;  
  padding-right: 6px;
  border-style: solid;
  border-width: 1px;
  border-color: #000000;
  background-color: #dddddd;  
}
h1
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 18pt;
  font-weight: bold;
  margin-bottom: 36px;
  color: #000000;
  margin-left: -40px;
}
h2
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 12pt;
  font-weight: bold;
  margin-top: 48px;
  margin-bottom: 24px;
  padding-top: 2px;
  padding-bottom: 2px;
  background-color: #dddddd;
  color: #000000;
  margin-left: -40px;
}
h3
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 11pt;
  font-weight: bold;
  margin-top: 36px;
  margin-bottom: 24px; 
  border-style: none;
  border-top-style: solid;  
  border-width: 1px;
  border-color: #cccccc; 
  margin-left: -40px;
}
h4
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 11pt;
  font-weight: bold;
  margin-top: 24px;
  margin-bottom: 12px;  
}
h5
{
  font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
  font-size: 9pt;
  font-weight: bold;
  margin-top: 12px;
  margin-bottom: 2px;  
}
a
{
  color: #0000ff;
}
p
{
  margin-top: 0px;
  margin-bottom: 6px;  
  width: 600px;
  text-align: justify;
}
ul
{
  margin-top: 0px;
  margin-bottom: 6px;  
  width: 600px;
  text-align: justify;
}
li
{
  margin-top: 0px;
  margin-bottom: 6px;  
  width: 550px;
  text-align: justify;
}
tt
{
  font-family: Courier, Courier New;
  font-size: 10pt;
}
pre
{
  background-color: #ffffff;
  color: #000000;
  font-size: 10pt;
}
.NAV
{
  font-size: 7pt;
}
a.NAV
{
  color: #0000cc;
}
.TOC
{
  font-size: 9pt;
  color: #888888;
}
a.TOC
{
  color: #0000ff;
}
.INDEX
{
  font-size: 9pt;
}
a.INDEX
{
  color: #0000ff;
}
.TYPE
{
  font-size: 7pt;
  color: #888888;
}
.ITEM
{
  font-weight: bold;
  color: #000088;
}
.LABEL
{
  color: #000088;
}
.HISTORY
{
  color: #006600;
}
.AUTHOR
{
  color: #006600;
}
.COPYRIGHT
{
  color: #006600;
}
.PORTABILITY
{
  color: #006600;
}
.WARNING
{
  color: #aa0000;
}

.bitinfo
{
  width: 60px;
  font-style: italic;
  text-align: center;
}

.bitnum
{
  text-align: center;
}

.bitname
{
  font-weight: bold;
  text-align: center;
}

.tabitem
{
  width: 100px;
}

.tabname
{
  width: 200px;
}

.tabdesc
{
  width: 450px;
}

.value
{
  font-family: courier;
  text-align: right;
}

.tabsepar
{
  border-top-style: solid;
  border-bottom-style: solid;
  border-width: 2px;
  border-color: #888888;
  font-style: italic;
  text-align: center;
}
</style>
</head>
<body bgcolor="#FFFFFF">
<a name="robo_top_of_doc"></a>
<h3 align="center">TABLE OF CONTENTS</h3>
<ul>
<li><a class="TOC" href="#robo5">calypso_card_read.c</a></li>
<li><a class="TOC" href="#robo102">CalypsoCardReadBinary</a></li>
<li><a class="TOC" href="#robo103">CalypsoCardReadRecord</a></li>
<li><a class="TOC" href="#robo105">CalypsoCardSelectApplication</a></li>
<li><a class="TOC" href="#robo106">CalypsoCardSelectDF</a></li>
<li><a class="TOC" href="#robo107">CalypsoCardSelectEF</a></li>
<li><a class="TOC" href="#robo108">CalypsoCardSelectFile</a></li>
</ul>
<h3>&nbsp;</h3>


<h1><a name="robo5"><span class="TYPE">[Modules]</span><a class="LABEL" name="calypso5fcard5fread2ec">
calypso_card_read.c</a></h1>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./modules.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   SpringCard Calypso API :: Card command set (files and application selection + reading)
</pre>
</span><p class="ITEM">COPYRIGHT</p>
<span class="COPYRIGHT"><pre class="COPYRIGHT">   (c) 2008 PRO ACTIVE SAS - See LICENCE.txt for licence information
</pre>
</span><p class="ITEM">AUTHOR</p>
<span class="AUTHOR"><pre class="AUTHOR">   Johann Dantant / PRO ACTIVE
</pre>
</span><p class="ITEM">HISTORY</p>
<span class="HISTORY"><pre class="HISTORY">   JDA 21/10/2008 : first public release
</pre>
</span>


<h2><a name="robo102"><span class="TYPE">[Functions]</span><a class="LABEL" name="CalypsoCardReadBinary">
CalypsoCardReadBinary</a></h2>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./functions.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   <strong>CalypsoCardReadBinary</strong>
</pre>
</span><p class="ITEM">DESCRIPTION</p>
<span class="DESCRIPTION"><pre class="DESCRIPTION">   Read bytes from an EF (must be a binary EF)
</pre>
</span><p class="ITEM">INPUTS</p>
<span class="INPUTS"><pre class="INPUTS">   CALYPSO_CTX_ST *ctx      : library context
   BYTE           sfi       : identifier of the file (0 for current file)
   WORD           offset    : address of first byte
   BYTE           ask_size  : size to be read ('Le' parameter in APDU - may be 0)
   BYTE           data[]    : buffer to receive the data
   CALYPSO_SZ     *datasize : input  = size of the data buffer
                              output = actual length of the data
</pre>
</span><p class="ITEM">RETURNS</p>
<span class="RETURNS"><pre class="RETURNS">   CALYPSO_RC            : 0 or an error code
</pre>
</span>


<h2><a name="robo103"><span class="TYPE">[Functions]</span><a class="LABEL" name="CalypsoCardReadRecord">
CalypsoCardReadRecord</a></h2>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./functions.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   <strong>CalypsoCardReadRecord</strong>
</pre>
</span><p class="ITEM">DESCRIPTION</p>
<span class="DESCRIPTION"><pre class="DESCRIPTION">   Read one record from the current EF (either cyclic or linear)
</pre>
</span><p class="ITEM">INPUTS</p>
<span class="INPUTS"><pre class="INPUTS">   CALYPSO_CTX_ST *ctx      : library context
   BYTE           sfi       : identifier of the file (0 for current file)
   BYTE           rec_no    : identifier of the record
   BYTE           rec_size  : expected size of the record ('Le' parameter in APDU - may be 0)
   BYTE           data[]    : buffer to receive the data
   CALYPSO_SZ     *datasize : input  = size of the data buffer
                              output = actual length of the data
</pre>
</span><p class="ITEM">RETURNS</p>
<span class="RETURNS"><pre class="RETURNS">   CALYPSO_RC               : 0 or an error code
</pre>
</span>


<h2><a name="robo105"><span class="TYPE">[Functions]</span><a class="LABEL" name="CalypsoCardSelectApplication">
CalypsoCardSelectApplication</a></h2>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./functions.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   <strong>CalypsoCardSelectApplication</strong>
</pre>
</span><p class="ITEM">DESCRIPTION</p>
<span class="DESCRIPTION"><pre class="DESCRIPTION">   Select the Calypso application
</pre>
</span><p class="ITEM">WARNING</p>
<span class="WARNING"><pre class="WARNING">   This function is not supported by Rev.1 cards
</pre>
</span><p class="ITEM">INPUTS</p>
<span class="INPUTS"><pre class="INPUTS">   CALYPSO_CTX_ST  *ctx     : library context
   const BYTE      aid[]    : AID of the application to select, possibly right truncated
   CALYPSO_SZ      aidsize  : length of the AID
   BYTE            fci[]    : buffer to receive the FCI of the selected application
   CALYPSO_SZ      *fcisize : input  = size of the FCI buffer
                              output = actual length of the FCI
</pre>
</span><p class="ITEM">RETURNS</p>
<span class="RETURNS"><pre class="RETURNS">   CALYPSO_RC               : 0 or an error code
</pre>
</span><p class="ITEM">NOTES</p>
<span class="NOTES"><pre class="NOTES">   If aid is NULL, the function will be performed using "1TIC.ICA" as default AID.
   On success, the FCI is parsed, you may access its content using
   - CalypsoCardRevision
   - CalypsoCardDFName
   - CalypsoCardSerialNumber
   - CalypsoCardMaxSessionUpdates
</pre>
</span>


<h2><a name="robo106"><span class="TYPE">[Functions]</span><a class="LABEL" name="CalypsoCardSelectDF">
CalypsoCardSelectDF</a></h2>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./functions.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   <strong>CalypsoCardSelectDF</strong>
</pre>
</span><p class="ITEM">DESCRIPTION</p>
<span class="DESCRIPTION"><pre class="DESCRIPTION">   Select a DF
</pre>
</span><p class="ITEM">INPUTS</p>
<span class="INPUTS"><pre class="INPUTS">   CALYPSO_CTX_ST *ctx      : library context
   WORD           file_id   : identifier of the file
   BYTE           resp[]    : buffer to receive the response to select
   CALYPSO_SZ     *respsize : input  = size of the response buffer
                              output = actual length of the response
</pre>
</span><p class="ITEM">RETURNS</p>
<span class="RETURNS"><pre class="RETURNS">   CALYPSO_RC               : 0 or an error code
</pre>
</span>


<h2><a name="robo107"><span class="TYPE">[Functions]</span><a class="LABEL" name="CalypsoCardSelectEF">
CalypsoCardSelectEF</a></h2>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./functions.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   <strong>CalypsoCardSelectEF</strong>
</pre>
</span><p class="ITEM">DESCRIPTION</p>
<span class="DESCRIPTION"><pre class="DESCRIPTION">   Select an EF under current DF
</pre>
</span><p class="ITEM">INPUTS</p>
<span class="INPUTS"><pre class="INPUTS">   CALYPSO_CTX_ST *ctx      : library context
   WORD           file_id   : identifier of the file
   BYTE           resp[]    : buffer to receive the response to select
   CALYPSO_SZ     *respsize : input  = size of the response buffer
                              output = actual length of the response
</pre>
</span><p class="ITEM">RETURNS</p>
<span class="RETURNS"><pre class="RETURNS">   CALYPSO_RC               : 0 or an error code
</pre>
</span>


<h2><a name="robo108"><span class="TYPE">[Functions]</span><a class="LABEL" name="CalypsoCardSelectFile">
CalypsoCardSelectFile</a></h2>

<p class="NAV">[<a class="NAV" href="#robo_top_of_doc">top</a>][<a class="NAV" href="./functions.html#top">index</a>]</p>
<p class="ITEM">NAME</p>
<span class="NAME"><pre class="NAME">   <strong>CalypsoCardSelectFile</strong>
</pre>
</span><p class="ITEM">DESCRIPTION</p>
<span class="DESCRIPTION"><pre class="DESCRIPTION">   Select an EF or a DF (or the MF)
</pre>
</span><p class="ITEM">INPUTS</p>
<span class="INPUTS"><pre class="INPUTS">   CALYPSO_CTX_ST *ctx      : library context
   DWORD          file_id   : identifier of the file (see below)
   BYTE           resp[]    : buffer to receive the response to select
   CALYPSO_SZ     *respsize : input  = size of the response buffer
                              output = actual length of the response
</pre>
</span><p class="ITEM">RETURNS</p>
<span class="RETURNS"><pre class="RETURNS">   CALYPSO_RC               : 0 or an error code
</pre>
</span><p class="ITEM">NOTES</p>
<span class="NOTES"><pre class="NOTES">   file_id is a DWORD (4 bytes) value constructed as follow :
   - 0x0000XXXX : selects EF with ID XXXX under current DF
   - 0xYYYYXXXX : selects EF with ID XXXX under DF with ID YYYY
   - 0x00000000 : selects the Master File
</pre>
</span>
<hr />
Generated from <b>calypso_card_read.c</b> on Thu Jun 24 12:26:46 2010<br />
</body>
</html>
